package info.motteke.net;

public enum StatusCode {

    CONTINUE(100),
    SWITCHING_PROTOCOLS(101),
    OK(200),
    CREATED(201),
    ACCEPTED(202),
    NON_AUTHORITATIVE_INFORMATION(203),
    NO_CONTENT(204),
    RESER_CONTENT(205),
    PARTIAL_CONTENT(206),
    ;

    private final int code;

    private static StatusCode[] values = values();

    private StatusCode(int code){
        this.code = code;
    }

    public static StatusCode valueOf(int code){
        for(StatusCode sc : values){
            if(sc.intValue() == code){
                return sc;
            }
        }
        return null;
    }

    public int intValue(){
        return this.code;
    }
}
